package com.ruoyi.order.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.order.api.domain.ErpSellerChildOrder;
import com.ruoyi.order.api.domain.ErpSellerChildOrderExtend;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(contextId = "remoteErpChildOrderService", value = ServiceNameConstants.ORDER_SERVICE)
public interface RemoteErpChildOrderService {

    /**
     * 根据子订单号获取子订单拓展信息
     */
    @GetMapping("/purchase/sellerChildOrderExtend/getChildExtendByChildOrder/{childOrderId}")
    ErpSellerChildOrderExtend getChildExtendByChildOrder(@PathVariable("childOrderId") String childOrderId);
    /**
     * 根据订单号获取子订单拓展信息
     */
    @GetMapping("/purchase/sellerChildOrderExtend/getChildExtendByOrder/{orderId}")
    List<ErpSellerChildOrderExtend> getChildExtendByOrder(@PathVariable("orderId") Long orderId);

    /**
     * 修改子订单拓展表信息
     */
    @PutMapping("/purchase/sellerChildOrderExtend/updateChildExtend")
    R<Void> updateChildExtend(@RequestBody ErpSellerChildOrderExtend childOrderExtend);
    
    /**
     * 根据订单号获取子订单
     */
    @GetMapping("/order/storeChildOrder/getChildByOrder/{orderId}")
    List<ErpSellerChildOrder> getChildByOrder(@PathVariable("orderId") Long orderId);

    /**
     * 根据子订单号获取子订单信息
     * @param childOrderId
     * @return
     */
    @GetMapping("/order/storeChildOrder/getChildByChildId/{childOrderId}")
    ErpSellerChildOrder getChildByChildId(@PathVariable("childOrderId") String childOrderId);
    

    /**
     * 判断商品是否出单
     * @param productIds 商品ids
     * @param moduleReplace 前几天
     * @return 出单量
     */
    @GetMapping("/order/storeChildOrder/isOrderPlacedForProduct")
    Boolean isOrderPlacedForProduct(@RequestParam("productIds") String productIds, @RequestParam(value = "moduleReplace", required = false) Integer moduleReplace);


    /**
     * 根据店铺cn码查看过去几天是否有订单
     * @param beforeDay
     * @param storeUserName
     * @return
     */
    @GetMapping("/order/storeChildOrder/getChildOrdersByBeforeDays")
    R<Object> getChildOrdersByBeforeDays(@RequestParam("beforeDay") Integer beforeDay,
                                         @RequestParam("storeUserName") String storeUserName,
                                         @RequestParam(value = "shieldProductIds", required = false) String shieldProductIds);

    /**
     * 根据类型获取店铺运营数据
     * @param productId
     * @param dataType
     * @return
     */
    @GetMapping("/order/storeChildOrder/getProductOperationsData/{productId}/{dataType}")
    R<Object> getProductOperationsData(@PathVariable("productId") String productId,
                                         @PathVariable("dataType") String dataType);
    
    


//    /**
//     * 判断上一单是否是测评单
//     * @param storeUserName
//     * @param skuCode
//     * @return
//     */
//    @GetMapping("/order/storeChildOrder/getIsEvaluationBySkuCode/{storeUserName}/{skuCode}")
//    R<Object> getIsEvaluationBySkuCode(@PathVariable("storeUserName") String storeUserName,
//                                              @PathVariable("skuCode") String skuCode);
}
